package com.sfac.hqyj.springBoot.modules.common.entity;

/*
此类用于封装数据
 */
public class ResultEntity<T> {
    private int states;
    private String message;
    private T data;//泛型可以储存任何数据，即可以封装任意数据
    public ResultEntity(){}

    public ResultEntity(int states, String message) {
        this.states = states;
        this.message = message;
    }

    public ResultEntity(int states, String message, T data) {
        this.states = states;
        this.message = message;
        this.data = data;
    }

    public int getStates() {
        return states;
    }

    public void setStates(int states) {
        this.states = states;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
    //枚举
    public enum ResultStatus{
        SUCCESS(200),FAILED(500);

        public int code;

        ResultStatus(int status){
            this.code=status;
        }
    }
}
